home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
hacklist
/
94-04.Z
/
94-04
/
000012_rcq@mailserv-D.ftp.com_Sat Apr 9 13:34:59 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-04-30
|
2KB
Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA18482; Sat, 9 Apr 1994 17:35:55 -0400
Received: from ftp.com by ftp.com ; Sat, 9 Apr 1994 17:35:54 -0400
Received: from mailserv-D.ftp.com by ftp.com ; Sat, 9 Apr 1994 17:35:54 -0400
Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
id AA21637; Sat, 9 Apr 94 17:34:59 EDT
Date: Sat, 9 Apr 94 17:34:59 EDT
Message-Id: <9404092134.AA21637@mailserv-D.ftp.com>
To: Bruce@isi.FrontierTech.COM
Subject: Re: Curious behaviour from winsock
From: rcq@ftp.com (Bob Quinn)
Reply-To: rcq@ftp.com
Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
Sender: rcq@mailserv-D.ftp.com
Repository: mailserv-D.ftp.com, [message accepted at Sat Apr 9 17:34:55 1994]
Originating-Client: hurricane.ftp.com
Content-Length: 1571
> icode@teleport.com (Mark Clouden) writes:
> >When using non blocking sockets with lingering enabled (l_onoff=1,
> >l_linger!=0), I call closesocket and get WSAEWOULDBLOCK back. Now great,
> >I expected that, but where is my notification message when it does
> >close?? Or actually, when will it close? - because according to my
> >network monitor app the socket is still connected.
>
> I don't know about the second problem (the connection not actually
> closing), but I wouldn't expect you would get any more notifications on a
> socket after you closesocket it, since the socket descriptor is then
> invalidated. If you want full graceful shutdown and notifications along
> the way, I would suggest shutting down for writing to close your end, and
> reading 'til "end-of-file" to detect the other side's close.
I agree with your suggested method for the most robust way to
close a socket; that's what we recommend also. But it's certainly
reasonable to call closesocket() and expect an FD_CLOSE when the
graceful close completes (e.g. FIN response received, so TIME_WAIT
state entered) or the graceful close attempt times out.
For example, assuming your application initiated the close (called
closesocket() first), then you'd be in FIN_WAIT. On page 91 in the
documentation for WSAAsyncSelect() the spec says "The FD_CLOSE is
posted when the connection goes into FIN_WAIT or CLOSE_WAIT states."
Regards,
--
Bob Quinn rcq@ftp.com
FTP Software, Inc. No. Andover, MA